//@ts-nocheck
import React from '../../react'
import ReactDOM from '../../react-dom';

/** 测试组件根节点属性更新 */
class Counter extends React.Component {
  constructor(props) {
    super(props);
    this.state = {number: 0}
  }

  handleClick = () => {
    this.setState(state => ({number: state.number + 1}));
  };

  render(){
    return (
      <div id={'counter' + this.state.number}>
        {/** ↓此时已经可以更新这里可*/}
        <p>{this.state.number}</p>
        <button onClick={this.handleClick}>+</button>
      </div>
    );
  }
}

ReactDOM.render(
  <Counter/>,
  document.getElementById('root')
);
